package demo;
public class Dog  extends Animal{ //继承动物父类
    public String name="旺财";
    public void barks(){ //子类增加的新成员
        System.out.println("汪汪汪");
    }
    public static void main(String[] args) {
        Dog dog=new Dog();
        dog.gender="公";
        dog.age=3;
        System.out.println(dog.name);
        System.out.println(dog.age);
        System.out.println(dog.gender);
        dog.move();
        dog.eat();
        dog.barks();
    }


}
